package com.czkt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.czkt.entity.SalPlan;
import com.czkt.entity.vo.PlanAndChance;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2024-06-18
 */
@Mapper
public interface SalPlanMapper extends BaseMapper<SalPlan> {
    @Select("select * from sal_plan left join crm.sal_chance sc on sc.chc_id = sal_plan.pla_chc_id where sc.chc_cust_name like concat('%',#{chcCustName},'%') and sc.chc_linkman like concat('%',#{chcLinkman},'%') and sc.chc_title like concat('%',#{chcTitle},'%')")
    IPage<PlanAndChance> selectBatchIds(IPage<PlanAndChance> planIPage, @Param("chcCustName") String chcCustName, @Param("chcLinkman") String chcLinkman, @Param("chcTitle") String chcTitle);

    @Select("select * from sal_plan where pla_id = #{plaId}")
    SalPlan selectAllByPlaChcId(String plaId);
}
